package com.bxmdm.ragdemo.dto;

import java.util.ArrayList;
import java.util.List;

public class QAPair {
    private String question;
    private String answer;
    private List<String> allAnswers;
    private double similarity; // 添加相似度字段

    public QAPair() {
    }

    // 添加这个构造函数来解决错误
    public QAPair(String question, String answer, List<String> allAnswers) {
        this.question = question;
        this.answer = answer;
        this.allAnswers = allAnswers != null ? allAnswers : new ArrayList<>();
    }

    public QAPair(String question, String answer) {
        this.question = question;
        this.answer = answer;
        this.allAnswers = null;
    }

    // Getter 和 Setter 方法
    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public List<String> getAllAnswers() {
        return allAnswers;
    }

    public void setAllAnswers(List<String> allAnswers) {
        this.allAnswers = allAnswers;
    }

    public double getSimilarity() {
        return similarity;
    }

    public void setSimilarity(double similarity) {
        this.similarity = similarity;
    }
}